/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine - graphics/scene
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AECamera.cpp
// Author:		Gianluca Belardelli
// Date:		11/12/2014
//
/////////////////////////////////////////////////////////////////////////
#include <AEEngine.h>

AECamera::AECamera( void ) : AE3DObject()
{
	m_vcWorldPosition.Set( 0.0f, 0.0f, 0.0f, 0.0f );
	m_vcOrientation.Set( 0.0f, 0.0f, 0.0f, 0.0f );
	m_matCachedRotMatrix.SetIdentity();
}

AECamera::~AECamera( void )
{
}
	
void AECamera::Set( const AEMatrix3f &mtCameraMatrix, const AEVector4f &vcPosition )
{
	m_matCachedRotMatrix.SetIdentity();
	m_matCachedRotMatrix.SetColumn<0>( mtCameraMatrix.GetColumn<0>() );
	m_matCachedRotMatrix.SetColumn<1>( mtCameraMatrix.GetColumn<1>() );
	m_matCachedRotMatrix.SetColumn<2>( mtCameraMatrix.GetColumn<2>() );

	m_matCachedRotMatrix.SetElement<3,0>( -(mtCameraMatrix.GetColumn<0>().GetDot<3>( vcPosition ) ) );
	m_matCachedRotMatrix.SetElement<3,1>( -(mtCameraMatrix.GetColumn<1>().GetDot<3>( vcPosition ) ) );
	m_matCachedRotMatrix.SetElement<3,2>( -(mtCameraMatrix.GetColumn<2>().GetDot<3>( vcPosition ) ) );
}

void AECamera::Set( const AEMatrix4f &mtCameraMatrix )
{
	m_matCachedRotMatrix = mtCameraMatrix;
}

/*
void AECamera::AttachToEntity(VisBaseEntity_cl *entity, const AEVector3f& spawnPos, const AEMatrix3f* rotationMatrix )
{
}

VisVisibilityZone_cl *AECamera::GetVisibilityZone() const
{
}
*/
	
const AEVector4f AECamera::GetDirection( void ) const
{
	return AEVector4f();
}
	
AEBOOL32 AECamera::IsActive( void ) const
{
	return 1;
}
	
void AECamera::Update( void )
{
}
	
AEMatrix3f AECamera::GetCameraToWorldRotation( void ) const
{
	return AEMatrix3f();
}
	
AEMatrix3f AECamera::GetWorldToCameraRotation( void ) const
{
	return AEMatrix3f();
}
	
AEMatrix4f AECamera::GetCameraToWorldTransformation( void ) const
{
	return AEMatrix4f();
}
	
AEMatrix4f AECamera::GetWorldToCameraTransformation( void ) const
{
	return m_matCachedRotMatrix;
}
